/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package traffic.light.simulator.town.unity;

/**
 * Factory for the town unities
 *
 */
public class TownUnityFactory {

    public static TownUnity construct(CrossRoadType type, int positionX, int positionY, int townSize) {
        TownUnity tu = null;
        switch (type) {
            case TYPE_0:
                tu = new TownUnityType0(positionX, positionY, townSize);
                break;

            case TYPE_1:
                tu = new TownUnityType1(positionX, positionY, townSize);
                break;

            case TYPE_2:
                tu = new TownUnityType2(positionX, positionY, townSize);
                break;

            case TYPE_3:
                tu = new TownUnityType3(positionX, positionY, townSize);
                break;

            case TYPE_4:
                tu = new TownUnityType4(positionX, positionY, townSize);
                break;

            case TYPE_5:
                tu = new TownUnityType5(positionX, positionY, townSize);
                break;

            case TYPE_6:
                tu = new TownUnityType6(positionX, positionY, townSize);
                break;
            case TYPE_7:
                tu = new TownUnityType7(positionX, positionY, townSize);
                break;

            case TYPE_8:
                tu = new TownUnityType8(positionX, positionY, townSize);
                break;

            case TYPE_9:
                tu = new TownUnityType9(positionX, positionY, townSize);
                break;

            case TYPE_10:
                tu = new TownUnityType10(positionX, positionY, townSize);
                break;
            default:
                tu = new TownUnityType11(positionX, positionY, townSize);
        }
        return tu;
    }
}
